1. Field of the Invention
The present invention relates to an object measuring apparatus for performing a process of counting the number of moving objects, and techniques related thereto.
2. Description of the Background Art
There are techniques of using an optical flow in order to measure movement of a moving object (for example, see “Tracking a Person with 3-D Motion by Integrating Optical Flow and Depth”, by R. Okada, Y. Shirai, and J. Miura, Proc. 4th Int. Conf. on Automatic Face and Gesture Recognition, pp. 336-341, March, 2000 (Non-Patent Document 1) and Japanese Patent Application Laid-Open No. 2002-8018 (Patent Document 1)). The optical flow denotes a “vector field” constructed by “motion vectors” of corresponding pixels in two images.
In such techniques, a camera is located at a predetermined position and an optical flow is obtained from a motion image captured by the camera. For example, by obtaining motion vectors in a plurality of positions (detection points) in a two-dimensional region, an optical flow is obtained. By using the obtained optical flow, a moving object is detected and tracked.
With the techniques employed, in accordance with whether a tracked object passes a boundary line or not, the number of objects passing the boundary line can be counted.
However, in the case of employing the technique disclosed in Non-Patent Document 1 (also referred to as “first conventional art”) in the above-described techniques, it is necessary to obtain a large number of motion vectors in a plurality of positions (detection points) in a two-dimensional region. It causes problems of a heavy processing load and long calculation time.
To address such a problem, Patent Document 1 discloses a technique of measuring the number of passages of moving objects not by obtaining motion vectors in a plurality of detection points provided in a two-dimensional region but by using motion vectors in a relatively small number of detection points provided in a one-dimensional direction (also referred to as “second conventional art”). More specifically, about 40 to 80 detection points are disposed in a one-dimensional direction of an approach position of a moving object, and motion vectors are detected with respect to the detection points. A time point when the total number of detection points at each of which a motion vector that is not zero (zero vector) is detected among the detection points becomes a threshold value or more is regarded as a time point when the head of a moving object passes, and a time point when the total number of similar detection points becomes a threshold value or less is regarded as a time point when the end of the moving object passes, thereby measuring a physical amount of the moving object. According to such a technique, as compared with the case of obtaining motion vectors in a number of detection points in a two-dimensional region, by decreasing the number of detection points, processing speed can be improved.
However, the technique of Patent Document 1 (second conventional art) has a problem in that the number of passages of moving objects is erroneously counted in the case where a plurality of moving objects pass a boundary line simultaneously. A situation is assumed that while a moving object (the first moving object) passes a boundary line, another moving object (the second moving object) reaches the boundary line. In this situation, when the second conventional art is employed, the total number of detection points in each of which a motion vector which is not zero is detected regarding the second moving object increases to a threshold or more before the total number of similar detection points regarding the first moving object decreases to the threshold or less. Consequently, there is a case that two moving objects cannot be counted separately.